@include('admin.public.head')
@include('admin.public.pop')

<style type="text/css">
    .inner_btn {
        background: #19a97b;
        color: white;
        padding: 5px 8px;
        border-radius: 2px;
    }
</style>

<div class="ibox-title">
    <h5>用户积分记录&nbsp;&nbsp;{{$user_info->total_integral}}</h5>
</div>

<div class="ibox-content">

    <a href="javascript:void(0)" url="/record_edit/{{$id}}" onclick="toggle($(this), '60%', '60%',  '操作積分')" class="btn btn-sm btn-primary">操作积分</a>

    <div class="row">
        <div class="col-sm-12 pull-right m-b-xs">
            <form action="">

                <div class="col-sm-1  m-b-xs text-center pull-right">
                    <button type="submit" class="btn btn-sm btn-primary">搜索</button>&nbsp;&nbsp;
                </div>

                <div class="col-sm-1 text-center pull-right">
                    <select class="form-control" name="chage_type">
                        <option value="">选择审核状态</option>
                        <option value="1" @if($chage_type == 1) selected @endif>客服加分</option>
                        <option value="2" @if($chage_type == 2) selected @endif>購買課程</option>
                        <option value="3" @if($chage_type == 3) selected @endif>過期作廢</option>
                        <option value="4" @if($chage_type == 4) selected @endif>扣減剩餘</option>
                        <option value="5" @if($chage_type == 5) selected @endif>客服扣分</option>
                    </select>
                </div>


                @include('admin.public.common.where_time_input')

            </form>
        </div>
    </div>

    <table class="table table-bordered">

        <thead>
            <tr>
                <th>积分描述</th>
                <th>积分变动类型</th>
                <th>操作积分</th>
                <th>时间</th>
            </tr>
        </thead>

        <tbody>
            @foreach ($user_lists as $k=>$v)
                <tr>
                    <td>
                        {{$v->reason??''}}
                    </td>
                    <td>
                        @if($v->chage_type == '1') 客服加分 @endif
                        @if($v->chage_type == '2') 購買課程 @endif
                        @if($v->chage_type == '3') 过期作废 @endif
                        @if($v->chage_type == '4') 扣减剩余 @endif
                        @if($v->chage_type == '5') 客服扣分 @endif
                    </td>
                    <td>
                        {{$v->use_integral??''}}
                    </td>
                    <td>
                        {{$v->created_at}}
                    </td>
                </tr>
            @endforeach
        </tbody>

        {{ $user_lists->appends(Request::except ('page'))->links() }}

    </table>
</div>
